<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.ncp.model.biz.index.NaviManager"%>
<%@page import="com.ncp.model.entity.index.NaviBean"%>
<%@page import="com.ncp.model.entity.cart.CartBean"%>
<jsp:useBean id="cart" scope="session" class="com.ncp.model.biz.cart.ShoppingCart"/>
<jsp:useBean id="cartbean" scope="session" class="com.ncp.model.entity.cart.CartBean"/>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

ArrayList al=new NaviManager().getAllNavi();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<script src="js/cart/cart.js" type="text/javascript" charset="UTF-8"></script>
    <base href="<%=basePath%>">
    <%
    	String userLoginName = (String)request.getSession().getAttribute("LoginName");
    %>
  </head>
  
  <body>
  <div id="top_bar" style="height:30px; width:100%; line-height:30px; background:#eee; border-bottom:1px solid #BBB;">
		<div id="box" style="width:922px; padding:0 40px; margin:0 auto;">
			<p class="left">
				Hi,
				<span id="name">
					<%
						if("".equals(userLoginName)||userLoginName==null){
							//用户没有登录
							%>
								请<a href="">登录</a>
								<a href="pages/registerlogin/register.jsp">免费注册</a>
							<%
						}else{
							out.print(userLoginName);
							%>
								<a href="LogoutServlet"> 退出</a>
								<a href="UpdateInfoServlet?userLoginName=<%=userLoginName%>"> 信息修改</a>
							<%
						}
					%>
				</span>
			</p>
			<ul class="right">
				<li><a href="#">网站首页</a></li>
				<li><a href="#">我的账户</a></li>
				<li id="hippo"><img src="images/absulote/shopping_cart.png" class="left" /><a class="left" href="pages/cart/shoppingcart.jsp">购物车<%=cart.getCartMap().size() %></>件</a></li>
				<li style="width:200px;"><input type="text" style="width:100px; height:20px; border:1px solid #ccc;"/><a href="#">搜索</a></li>
			</ul>
		</div>
		<!-- 购物车信息
    	<div id="shoppingcart"></div> 
    	-->
		<div style="clear:both;"></div>
	</div>
    <div id="nav">
		<div style="clear:both"></div>
   	 <ul id="nav_item">
			<%
			for(int i=0;i<al.size();i++){
				NaviBean nb=(NaviBean)al.get(i);
				%>
				<li><a href="<%=nb.getUrlpage() %>"><%=nb.getName() %></a></li>
				<%
			}
			%>
		</ul>
		<%--<% 
		if(!"".equals(userLoginName)&&userLoginName!=null){
			%>
		<ul id="nav_item">
		  <li><a href=""></a></li>
		</ul>
		<%
		} 
		%>
		--%><div style="clear:both"></div>
		
	</div>
  </body>
</html>
